<%-- 
    Document   : sv3_editS_match.jsp
    Created on : May 9, 2014, 10:48:42 AM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript">
            function checkSubmitSub(){
                var submit2 = false;
                $('.rb').each(function(){
                    if ($(this).is(':checked')) {
                        submit2 = true;
                        return;
                    }
                });
                
                if(!submit2){
                    alert('Please choose "Header" first before save. ');
                    return;
                }                
                
                var submit = false;
                $('.cb').each(function() {
                    if ($(this).is(':checked')) {
                        submit = true;
                        return;
                    }
                });
                
                if(!submit){
                    alert('Please thick at least One (1) "Add. Header". ');
                    return;
                }
                
                return submit;
            }
        </script>
        <style>
            .validateTips { border: 1px solid transparent; padding: 0.3em; font-weight: bold; font-size: 10pt;}
            em {color: red}
            
            div#dialog-form p{
                margin: 0px; padding: 0 0 10px 0; 
            }
            div#dialog-form label {
                width: 10em;
                float: left;
                text-align: right;
                margin-right: 10px;
                display: block;
                color: #000;
                font-family:Tahoma;
                font-size: 16px;
                margin-left: -0.5px;
            }
            div#dialog-form font, textArea {
                font-size: 13px;
            }
            div#dialog-form select { font-size: 13px; font-family: 'Tahoma', cursive; }
            div#dialog-form input { font-size: 13px;}
            .ui-dialog .ui-state-error { padding: .3em; }
        </style>
    </head>
    <body>
        <s:messages />
        <s:errors />
        <div id="dialog-form" title="Match Additional Header">
            <s:useActionBean beanclass="exatrez.stripes.util.ShipVisit3ListUtil" var="list"/>
            <s:form beanclass="exatrez.stripes.action.ShipVisit3AdminAction" name="popupForm">
                <s:hidden name="headerId" />
                <s:hidden name="departmentId" />
                <div>
                    <fieldset>
                        <div id="page-title">
                            <span class="title">Edit Match Additional Header for Ship Visit Form</span>
                        </div>
                        <p class="validateTips"><em>Note: </em>1) Header must be choose.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2) Add. Header must thick (&check;) at least One (1).</p>
                        <p>
                            <label>Department :</label>
                            ${actionBean.department.departmentName}&nbsp;
                        </p>
                        <p>
                            <label>Header :</label>                            
                            <table border="0" style="width: 40%">
                                <c:set var="valid" value="false" />
                                <c:set var="c" value="0" />
                                <c:forEach items="${actionBean.listMatch}" var="h">
                                    <tr>
                                        <td style="vertical-align: top">
                                            <s:radio value="${h.shipVisitHeader.refShipVisitHeaderId}" name="refHeader.refShipVisitHeaderId" id="rb${c}" class="rb" />
                                        </td>
                                        <td>
                                            ${h.shipVisitHeader.description}&nbsp;
                                        </td>
                                    </tr>
                                    <c:set var="c" value="${c + 1}" />
                                </c:forEach>
                            </table>
                        </p>
                        <p>
                            <label>Add. Header :</label>                            
                            <table border="0" style="width: 40%">
                                <c:set var="count" value="0" />
                                <c:forEach items="${list.listSub}" var="h">
                                    <tr>
                                        <td style="vertical-align: top">
                                            <s:checkbox value="${h.refShipVisitSubId}" name="listSubHeaderSelect" id="cb${count}" class="cb" />
                                        </td>
                                        <td>
                                            ${h.description}&nbsp;
                                        </td>
                                    </tr>
                                    <c:set var="count" value="${count + 1}" />
                                </c:forEach>
                            </table>
                        </p>
                    </fieldset>
                </div>
            </s:form>
        </div>
    </body>
</html>